$(function(){
    $("#name").autocomplete({
        source:function(req,add){
            $.getJSON('AjaxAutocomplete.php?callback=?',req,function(data){
                 var suggestions=[]; 
                 $.each(data,function(i,val){
                    suggestions.push(val.name);
                     
                 });
                 //console.log(suggestions);
                 
                 add(suggestions);
            });  
        },
        width:50,
        max: 10,
        height:10,
        scroll: true,
        autoFill:true,
        height:300,
        
    });

});